

<template>
  <div class="car-run-count-wrap">
    <WiChart  :options="options"/>
  </div>
</template>
<script setup lang="ts">

import WiChart from "@/components/WiChart.vue";
import {chartOptionFun} from "./chartOption.js"
import {onMounted, ref} from "vue";
import {biApi} from "@/views/vms-bi/biApi";
const options = ref({})

const getData = ()=>{
  biApi.getMileageMonth().then((res:any[])=>{
    console.log(res,"dddd")
    let xData = []
    let yData = []
    Object.keys(res).forEach(item=>{
      let newKey = item.replace(":","/")
      xData.push(newKey)
      yData.push(res[item])
    })
    options.value = chartOptionFun(xData,yData);
  })
}


onMounted(()=>{
  getData()
  // options.value = chartOptionFun();
})
</script>
<style scoped lang="scss">
.car-run-count-wrap{
  height: 100%;
  width: 100%;
}
</style>